﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace WinnerCMS.Data.Mapping
{
    public partial class AreaMap
        : EntityTypeConfiguration<WinnerCMS.Model.Area>
    {
        public AreaMap()
        {
            // table
            //ToTable("CMS_Area");

            // keys
            HasKey((t => t.Code));

            // Properties
            Property((t => t.Code))
                
                .IsRequired();
            Property(t => t.Name)
                
                .HasMaxLength(50)
                .IsRequired();
            Property(t => t.ParentCode)
                
                .IsOptional(); 
            Property(t => t.Level)
                
                .IsOptional();
            Property(t => t.Path)
                
                .HasMaxLength(250)
                .IsOptional();
            Property(t => t.FullName)
                
                .HasMaxLength(250)
                .IsOptional();
            Property(t => t.Abbreviation)
                
                .HasMaxLength(50)
                .IsOptional();
       

            // Relationships

            //InitializeMapping();
        }
    }
}

